package com.example.bookstore.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "BOOKS", schema = "bookstore")
public class Book implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id")
	private long bookId;
	private String description;
	@Column(name = "first_name")
	private String firstName;
	@Column(name = "last_name")
	private String lastName;
	private String title;
	@Column(name = "sale_discount")
	private float discountRate;
	private float price;
	@Column(name = "calendar_year")
	private int calendarYear;
	private int inventory;

	public Book() {
	}

	public Book(long bookId, String surname, String firstName, String title,
			float price, float discountRate, int calendarYear,
			String description, int inventory) {
		this.bookId = bookId;
		this.title = title;
		this.firstName = firstName;
		this.lastName = surname;
		this.price = price;
		this.discountRate = discountRate;
		this.calendarYear = calendarYear;
		this.description = description;
		this.inventory = inventory;
	}

	public String getBookId() {
		return Long.toString(bookId);
	}

	public String getTitle() {
		return this.title;
	}

	public String getFirstName() {
		return this.firstName;
	}

	public String getLastName() {
		return this.lastName;
	}

	public float getPrice() {
		return this.price;
	}

	public float getDiscountRate() {
		return discountRate;
	}

	public int getCalendarYear() {
		return this.calendarYear;
	}

	public String getDescription() {
		return this.description;
	}

	public int getInventory() {
		return this.inventory;
	}

	public void setBookId(String id) {
		this.bookId = Long.parseLong(id);
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public void setDiscountRate(float rate) {
		this.discountRate = rate;
	}

	public void setCalendarYear(int calendarYear) {
		this.calendarYear = calendarYear;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setInventory(int inventory) {
		this.inventory = inventory;
	}
}
